<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="/template.xhtml">
	<ui:define name="corpo">
		<h:form id="cadastroEquipe">
			<h:panelGrid id="panelGridCadastro" columns="2">
				<f:facet name="header">  
	                                        Cadastro de Equipe 
	                                </f:facet>

				<h:outputLabel for="id" value="Id: *" style="display: none" />
				<h:inputHidden id="id" size="50" value="#{equipeAction.equipe.id}">
				</h:inputHidden>

				<h:outputLabel for="nome" value="Nome: *" />
				<h:inputText id="nome" size="50" value="#{equipeAction.equipe.nome}"
					title="Insira o nome da equipe." label="Nome">
				</h:inputText>

				<f:facet name="footer">
					<h:commandButton value="Salvar" styleClass="btn"
						style="width: 100%;" action="#{equipeAction.salvar()}" />
				</f:facet>
			</h:panelGrid>

			<p:dataTable id="dataTableEquipeUsuarios" var="usuario" rendered="#{equipeAction.mostrarListaUsuarios}"
				value="#{equipeAction.equipe.usuarios}" paginator="true" rows="15" lazy="true"
				paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
				rowsPerPageTemplate="5,10,15">
				<f:facet name="header">  
           	Membros da Equipe #{equipeAction.equipe.nome}  
        </f:facet>

				<p:column>
					<f:facet name="header">
						<h:outputText value="Nome" />
					</f:facet>
					<h:outputText value="#{usuario.nome}" />
				</p:column>

				<p:column>
					<f:facet name="header">
						<h:outputText value="E-mail" />
					</f:facet>
					<h:outputText value="#{usuario.email}" />
				</p:column>

				<p:column>
					<f:facet name="header">
						<h:outputText value="Telefone" />
					</f:facet>
					<h:outputText value="#{usuario.telefone}" />
				</p:column>

			</p:dataTable>

		</h:form>
	</ui:define>
</ui:composition>
</html>